package com.gitee.lougnib.simple.dummy;

import java.io.File;
import java.io.FileInputStream;
import java.util.Properties;

public class PropertyUtils {

	private static Properties configProperties = null;

	public static String get(String key) {
		init();
		if (configProperties.containsKey(key)) {
			return configProperties.getProperty(key);
		}

		return "";
	}

	private static void init() {
		try {
			if (configProperties == null) {
				configProperties = new Properties();
				configProperties
						.load(new FileInputStream(new File(System.getenv().get("CONFIG_PATH"), "config.properties")));
			}
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
}
